package org.baojie.raft.box;

import org.baojie.raft.group.RaftGroup;
import org.baojie.raft.message.RaftMsgSignal;
import org.baojie.raft.node.NodeName;
import org.baojie.raft.message.RaftMessage;
import org.baojie.raft.node.type.Role;
import org.baojie.raft.store.NodeStore;

public interface Box {

    void start();

    void stop();

    NodeName name();

    RaftGroup group();

    NodeStore store();

    RaftMsgSignal touchStartVote(String msgId);

    void doNodeVote(Role role, int stamp, String msgId);

    void dealHeartBeatPong(RaftMessage pong);

    void dealHeartBeatPing(RaftMessage ping, Role oldRole, int oldStamp);

    void receiveVoteRequest(RaftMessage voteRequest);

    void sendMessage(RaftMessage ping);

    void putPing(RaftMessage ping);

}
